//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<CRenderState10.h>
///	@path	~/src/graphics/dx10/
///	@date	2008/12/20
///	@desc	.

#pragma once

#include "xeres.h"

#include "graphics/IRenderState.h"
#include "graphics/dx10/CDevice10.h"

namespace xeres {
	
	/*! 
		\class	CRenderState10
		\brief
	*/
	class CRenderState10 : public IRenderState
	{
	public:

		/// \ctor
		CRenderState10( ID3D10StateBlock * block , D3D10_STATE_BLOCK_MASK * mask );

		/// \dtor
		virtual ~CRenderState10( void );

		DECL_IOBJECT_CLASS( CRenderState10 , IRenderState );

	public:

		///	\brief		Called when device is lost or before reset.
		virtual bool OnLostDevice( void );

		///	\brief		Called after device is reset.
		virtual bool OnResetDevice( RefWeak<IDevice> device );

		/// \brief	Determine if render state needs capture again.
		virtual bool RequireCapture( void );

		/// \brief	Capture current render state.
		virtual bool Capture( void );

		/// \brief	Apply render state to current.
		virtual bool Apply( void );

	private:

		// @data
		ID3D10StateBlock *			m_state;
		D3D10_STATE_BLOCK_MASK		m_mask;
		bool						m_lost;
		bool						m_spare[3];
	};

} // namespace xeres
